ask "Please name the copy" with "Copy of"&&newName
if it is empty then exit mouseup
put it into newName
set cursor to 4
put copyFile(myFile,newName) into myResult
if myResult<>0 then
OSErr "©1988SDrazga",myResult
else
Answer "Copy successful!"
end if
end mouseUp
-- part contents for background part 5
----- text -----
CopyFile
-- part contents for background part 6
----- text -----
The CopyFile XFCN was written by Brad J. Hicks to give HyperCard the ability to copy a file (such as a stack) with full script control (necessary for making backup copies of a stack automatically, for example).
Use it freely, but I would appreciate a thank-you or acknowledgement somewhere in the stack.
Brad J. Hicks
FidoNet:
1:100/523
CompuServe:
[76012,300]
US Mail:
11215 Sugartrail
St. Louis, MO 63136
-- part contents for background part 7
----- text -----
Syntax:
copyFile(<oldFile>,<newFile>)
If there aren't two parameters, copyFile returns 1; otherwise, it's the standard Macintosh error code (you can use the OSErr* XCMD to report these errors to the user.
The first parameter is the full path name to the original file.
The second parameter is the name of the copy of the original file.